#include<iostream>
using namespace std;

typedef long long ll;
const int N=1010;
ll sign[N][N];
void fun(ll x1, ll y1, ll x2, ll y2, ll x)
{
    sign[x1][y1]+=x;
    sign[x1][y2+1]-=x;
    sign[x2+1][y1]-=x;
    sign[x2+1][y2+1]+=x;
}
int main()
{
    int n, m;
    cin>>n>>m;
    while(m--)
    {
        ll x1, y1, x2, y2;
        cin>>x1>>y1>>x2>>y2;
        fun(x1, y1, x2, y2, 1);
    }
    for(int i=1; i<=n; i++)
    {
        for(int j=1; j<=n; j++)
        {
            sign[i][j]+=(sign[i-1][j]+sign[i][j-1]-sign[i-1][j-1]);
            cout<<sign[i][j]<<" ";
        }
        cout<<endl;
    }
    return 0;
}
